<template>
  <div>
    <!-- 三级联动全局组件   不需要引入直接用-->
    <TypeNav/>
    <ListContainer />
    <TodayRecommend />
    <GoodsRank />
    <GoodsLike />
    <GoodsFloor 
        v-for="(floor,index) in floorList" 
        :key="floor.id" 
        :list="floor"
    />
    <GoodsBrand/>
  </div>
</template>

<script>
// import TypeNav from '@/components/TypeNav'
import ListContainer from "./ListContainer/index.vue";
import TodayRecommend from "./Recommend/index.vue";
import GoodsRank from "./Rank/index.vue";
import GoodsLike from "./Like/index.vue";
import GoodsFloor from "./Floor/index.vue";
import GoodsBrand from "./Brand/index.vue";

import { mapState } from "vuex";
export default {
  name: "MyHome",
  components: {
   
    ListContainer,
    TodayRecommend,
    GoodsRank,
    GoodsLike,
    GoodsFloor,
    GoodsBrand,
  },
  mounted(){
    // 派发action 获取floor组件的数据
    this.$store.dispatch("home/getFloorList")
  },
  computed:{
    ...mapState('home',['floorList'])
  }
};
</script>

<style>
</style>